import pymysql

config = {
    'host': '172.26.17.202',
    'user': 'root',
    'password': '123456',
    'port': 3306,
    'database': 'ioe',
}


def db_connect():
    conn = None
    try:
        conn = pymysql.connect(host=config['host'], port=config['port'], user=config['user'],
                               password=config['password'], database=config['ioe'])
    except pymysql.OperationalError as e:
        print(f"Mysql Error{e.args[0]}:{e.args[1]}")
    return conn
